1
|
|
|
import { BaseEndpoint } from './baseEndpoint'; |
2
|
|
|
import { |
3
|
|
|
ConfigurationAPIResponse, |
4
|
|
|
ConfigurationCountriesResponse, |
5
|
|
|
ConfigurationJobsResponse, |
6
|
|
|
ConfigurationLanguagesResponse, |
7
|
|
|
ConfigurationPrimaryTranslationsResponse, ConfigurationTimezonesResponse, |
8
|
|
|
} from '../interfaces/configuration'; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Configuration Endpoint Class |
12
|
|
|
*/ |
13
|
|
|
export class Configuration extends BaseEndpoint { |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Get the system wide configuration information. |
17
|
|
|
* Some elements of the API require some knowledge of this configuration data. |
18
|
|
|
* @return { Promise<ConfigurationAPIResponse> } |
19
|
|
|
* @see https://developers.themoviedb.org/3/configuration/get-api-configuration |
20
|
|
|
*/ |
21
|
|
|
public async api(): Promise<ConfigurationAPIResponse> { |
22
|
|
|
return this.sendGetRequest(`configuration`); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Get the list of countries (ISO 3166-1 tags) used throughout TMDb. |
27
|
|
|
* @return { Promise<ConfigurationCountriesResponse> } |
28
|
|
|
* @see https://developers.themoviedb.org/3/configuration/get-countries |
29
|
|
|
*/ |
30
|
|
|
public async countries(): Promise<ConfigurationCountriesResponse> { |
31
|
|
|
return this.sendGetRequest('configuration/countries'); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Get a list of the jobs and departments we use on TMDb. |
36
|
|
|
* @return { Promise<ConfigurationJobsResponse> } |
37
|
|
|
* @see https://developers.themoviedb.org/3/configuration/get-jobs |
38
|
|
|
*/ |
39
|
|
|
public async jobs(): Promise<ConfigurationJobsResponse> { |
40
|
|
|
return this.sendGetRequest('configuration/jobs'); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Get the list of languages (ISO 639-1 tags) used throughout TMDb. |
45
|
|
|
* @return { Promise<ConfigurationLanguagesResponse> } |
46
|
|
|
* @see https://developers.themoviedb.org/3/configuration/get-languages |
47
|
|
|
*/ |
48
|
|
|
public async languages(): Promise<ConfigurationLanguagesResponse> { |
49
|
|
|
return this.sendGetRequest('configuration/languages'); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Get a list of the officially supported translations on TMDb. |
54
|
|
|
* @return { Promise<ConfigurationPrimaryTranslationsResponse> } |
55
|
|
|
* @see https://developers.themoviedb.org/3/configuration/get-primary-translations |
56
|
|
|
*/ |
57
|
|
|
public async primaryTranslations(): Promise<ConfigurationPrimaryTranslationsResponse> { |
58
|
|
|
return this.sendGetRequest('configuration/primary_translations'); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Get the list of timezones used throughout TMDb. |
63
|
|
|
* @return { Promise<ConfigurationTimezonesResponse> } |
64
|
|
|
* @see https://developers.themoviedb.org/3/configuration/get-timezones |
65
|
|
|
*/ |
66
|
|
|
public async timezones(): Promise<ConfigurationTimezonesResponse> { |
67
|
|
|
return this.sendGetRequest('configuration/timezones'); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
} |
71
|
|
|
|